<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Jetson Inference: glTexture Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="NVLogo_2D.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Jetson Inference
   </div>
   <div id="projectbrief">DNN Vision Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classglTexture.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classglTexture-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">glTexture Class Reference<div class="ingroups"><a class="el" href="group__util.html">Utilities Library (jetson-utils)</a> &raquo; <a class="el" href="group__OpenGL.html">OpenGL</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>OpenGL texture with CUDA interoperability.  
 <a href="classglTexture.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="glTexture_8h_source.html">glTexture.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:accb8f44543b92f75a137d768194a10d2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#accb8f44543b92f75a137d768194a10d2">~glTexture</a> ()</td></tr>
<tr class="memdesc:accb8f44543b92f75a137d768194a10d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free the texture.  <a href="#accb8f44543b92f75a137d768194a10d2">More...</a><br /></td></tr>
<tr class="separator:accb8f44543b92f75a137d768194a10d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a600cb151e484ef4497e50d96f9bfc2a9"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#a600cb151e484ef4497e50d96f9bfc2a9">Bind</a> ()</td></tr>
<tr class="memdesc:a600cb151e484ef4497e50d96f9bfc2a9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Activate using the texture.  <a href="#a600cb151e484ef4497e50d96f9bfc2a9">More...</a><br /></td></tr>
<tr class="separator:a600cb151e484ef4497e50d96f9bfc2a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a803c368b6a26675b4cc45b0aae47f9c3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#a803c368b6a26675b4cc45b0aae47f9c3">Unbind</a> ()</td></tr>
<tr class="memdesc:a803c368b6a26675b4cc45b0aae47f9c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deactivate using the texture.  <a href="#a803c368b6a26675b4cc45b0aae47f9c3">More...</a><br /></td></tr>
<tr class="separator:a803c368b6a26675b4cc45b0aae47f9c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aacbc1ed68a99930b628b41d69997227e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#aacbc1ed68a99930b628b41d69997227e">Render</a> (float x, float y)</td></tr>
<tr class="memdesc:aacbc1ed68a99930b628b41d69997227e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Render the texture at the specified window coordinates.  <a href="#aacbc1ed68a99930b628b41d69997227e">More...</a><br /></td></tr>
<tr class="separator:aacbc1ed68a99930b628b41d69997227e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38103fc1ec96018601b21131db5144c9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#a38103fc1ec96018601b21131db5144c9">Render</a> (float x, float y, float width, float height)</td></tr>
<tr class="memdesc:a38103fc1ec96018601b21131db5144c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Render the texture with the specified position and size.  <a href="#a38103fc1ec96018601b21131db5144c9">More...</a><br /></td></tr>
<tr class="separator:a38103fc1ec96018601b21131db5144c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab449860cc3d739a6615d93f4a1764f20"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#ab449860cc3d739a6615d93f4a1764f20">Render</a> (const float4 &amp;rect)</td></tr>
<tr class="memdesc:ab449860cc3d739a6615d93f4a1764f20"><td class="mdescLeft">&#160;</td><td class="mdescRight">Render the texture to the specific screen rectangle.  <a href="#ab449860cc3d739a6615d93f4a1764f20">More...</a><br /></td></tr>
<tr class="separator:ab449860cc3d739a6615d93f4a1764f20"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acba11f3282339fb2490c930177ec8562"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#acba11f3282339fb2490c930177ec8562">GetID</a> () const</td></tr>
<tr class="memdesc:acba11f3282339fb2490c930177ec8562"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the OpenGL resource handle of the texture.  <a href="#acba11f3282339fb2490c930177ec8562">More...</a><br /></td></tr>
<tr class="separator:acba11f3282339fb2490c930177ec8562"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4e7455f84741b4bc4601bd44df95063"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#ab4e7455f84741b4bc4601bd44df95063">GetWidth</a> () const</td></tr>
<tr class="memdesc:ab4e7455f84741b4bc4601bd44df95063"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the width in pixels of the texture.  <a href="#ab4e7455f84741b4bc4601bd44df95063">More...</a><br /></td></tr>
<tr class="separator:ab4e7455f84741b4bc4601bd44df95063"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e83b13ce1281d90a59c0cfca7f80834"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#a7e83b13ce1281d90a59c0cfca7f80834">GetHeight</a> () const</td></tr>
<tr class="memdesc:a7e83b13ce1281d90a59c0cfca7f80834"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the height in pixels of the texture.  <a href="#a7e83b13ce1281d90a59c0cfca7f80834">More...</a><br /></td></tr>
<tr class="separator:a7e83b13ce1281d90a59c0cfca7f80834"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a24d1124dd9e3ee4a885037680e034d24"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#a24d1124dd9e3ee4a885037680e034d24">GetFormat</a> () const</td></tr>
<tr class="memdesc:a24d1124dd9e3ee4a885037680e034d24"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the texture's format (e.g.  <a href="#a24d1124dd9e3ee4a885037680e034d24">More...</a><br /></td></tr>
<tr class="separator:a24d1124dd9e3ee4a885037680e034d24"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35ba15763a0a187bd4e103eda1e2ab5c"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#a35ba15763a0a187bd4e103eda1e2ab5c">GetSize</a> () const</td></tr>
<tr class="memdesc:a35ba15763a0a187bd4e103eda1e2ab5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the size in bytes of the texture.  <a href="#a35ba15763a0a187bd4e103eda1e2ab5c">More...</a><br /></td></tr>
<tr class="separator:a35ba15763a0a187bd4e103eda1e2ab5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a988866fe886ea2f07208e691a8b9a173"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#a988866fe886ea2f07208e691a8b9a173">Map</a> (uint32_t device, uint32_t flags)</td></tr>
<tr class="memdesc:a988866fe886ea2f07208e691a8b9a173"><td class="mdescLeft">&#160;</td><td class="mdescRight">Map the texture for accessing from the CPU or CUDA.  <a href="#a988866fe886ea2f07208e691a8b9a173">More...</a><br /></td></tr>
<tr class="separator:a988866fe886ea2f07208e691a8b9a173"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2f21d5b0b9235bf53744ca71e258841"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#aa2f21d5b0b9235bf53744ca71e258841">Unmap</a> ()</td></tr>
<tr class="memdesc:aa2f21d5b0b9235bf53744ca71e258841"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unmap the texture from CPU/CUDA access.  <a href="#aa2f21d5b0b9235bf53744ca71e258841">More...</a><br /></td></tr>
<tr class="separator:aa2f21d5b0b9235bf53744ca71e258841"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0067ed41cdddd4371d5292586c25cecf"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#a0067ed41cdddd4371d5292586c25cecf">Copy</a> (void *ptr, uint32_t flags)</td></tr>
<tr class="memdesc:a0067ed41cdddd4371d5292586c25cecf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy entire contents of the texture to/from CPU or CUDA memory.  <a href="#a0067ed41cdddd4371d5292586c25cecf">More...</a><br /></td></tr>
<tr class="separator:a0067ed41cdddd4371d5292586c25cecf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3e8a8080be69e6170b5870b80bf6e9c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#ae3e8a8080be69e6170b5870b80bf6e9c">Copy</a> (void *ptr, uint32_t size, uint32_t flags)</td></tr>
<tr class="memdesc:ae3e8a8080be69e6170b5870b80bf6e9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy contents of the texture to/from CPU or CUDA memory.  <a href="#ae3e8a8080be69e6170b5870b80bf6e9c">More...</a><br /></td></tr>
<tr class="separator:ae3e8a8080be69e6170b5870b80bf6e9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c607bd04f6f27df58ad2fa50546fb60"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#a8c607bd04f6f27df58ad2fa50546fb60">Copy</a> (void *ptr, uint32_t offset, uint32_t size, uint32_t flags)</td></tr>
<tr class="memdesc:a8c607bd04f6f27df58ad2fa50546fb60"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy contents of the texture to/from CPU or CUDA memory.  <a href="#a8c607bd04f6f27df58ad2fa50546fb60">More...</a><br /></td></tr>
<tr class="separator:a8c607bd04f6f27df58ad2fa50546fb60"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a3ab747085fde20860837129dcbc8582b"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classglTexture.html">glTexture</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classglTexture.html#a3ab747085fde20860837129dcbc8582b">Create</a> (uint32_t width, uint32_t height, uint32_t format, void *data=NULL)</td></tr>
<tr class="memdesc:a3ab747085fde20860837129dcbc8582b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocate an OpenGL texture.  <a href="#a3ab747085fde20860837129dcbc8582b">More...</a><br /></td></tr>
<tr class="separator:a3ab747085fde20860837129dcbc8582b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>OpenGL texture with CUDA interoperability. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="accb8f44543b92f75a137d768194a10d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#accb8f44543b92f75a137d768194a10d2">&#9670;&nbsp;</a></span>~glTexture()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">glTexture::~glTexture </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Free the texture. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a600cb151e484ef4497e50d96f9bfc2a9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a600cb151e484ef4497e50d96f9bfc2a9">&#9670;&nbsp;</a></span>Bind()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool glTexture::Bind </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Activate using the texture. </p>

</div>
</div>
<a id="a0067ed41cdddd4371d5292586c25cecf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0067ed41cdddd4371d5292586c25cecf">&#9670;&nbsp;</a></span>Copy() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool glTexture::Copy </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Copy entire contents of the texture to/from CPU or CUDA memory. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ptr</td><td>the memory pointer to copy to/from, either in CPU or CUDA address space depending on flags. It's assumed that the size of the memory from this pointer is equal to <a class="el" href="classglTexture.html#a35ba15763a0a187bd4e103eda1e2ab5c" title="Retrieve the size in bytes of the texture. ">GetSize()</a>, and the entire contents of the buffer will be copied.</td></tr>
    <tr><td class="paramname">flags</td><td>should be one of the following:<ul>
<li>GL_FROM_CPU (copy from CPU-&gt;OpenGL)</li>
<li>GL_FROM_CUDA (copy from CUDA-&gt;OpenGL)</li>
<li>GL_TO_CPU (copy from OpenGL-&gt;CPU)</li>
<li>GL_TO_CUDA (copy from OpenGL-&gt;CUDA)</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true on success, false on failure </dd></dl>

</div>
</div>
<a id="ae3e8a8080be69e6170b5870b80bf6e9c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae3e8a8080be69e6170b5870b80bf6e9c">&#9670;&nbsp;</a></span>Copy() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool glTexture::Copy </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Copy contents of the texture to/from CPU or CUDA memory. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ptr</td><td>the memory pointer to copy to/from, either in CPU or CUDA address space depending on flags.</td></tr>
    <tr><td class="paramname">size</td><td>the number of bytes to copy</td></tr>
    <tr><td class="paramname">flags</td><td>should be one of the following:<ul>
<li>GL_FROM_CPU (copy from CPU-&gt;OpenGL)</li>
<li>GL_FROM_CUDA (copy from CUDA-&gt;OpenGL)</li>
<li>GL_TO_CPU (copy from OpenGL-&gt;CPU)</li>
<li>GL_TO_CUDA (copy from OpenGL-&gt;CUDA)</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true on success, false on failure </dd></dl>

</div>
</div>
<a id="a8c607bd04f6f27df58ad2fa50546fb60"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8c607bd04f6f27df58ad2fa50546fb60">&#9670;&nbsp;</a></span>Copy() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool glTexture::Copy </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Copy contents of the texture to/from CPU or CUDA memory. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ptr</td><td>the memory buffer to copy to/from, either in CPU or CUDA address space depending on flags</td></tr>
    <tr><td class="paramname">offset</td><td>the offset into the OpenGL buffer to copy. It is assumed any offset to the CPU/CUDA pointer argument has already been applied.</td></tr>
    <tr><td class="paramname">size</td><td>the number of bytes to copy</td></tr>
    <tr><td class="paramname">flags</td><td>should be one of the following:<ul>
<li>GL_FROM_CPU (copy from CPU-&gt;OpenGL)</li>
<li>GL_FROM_CUDA (copy from CUDA-&gt;OpenGL)</li>
<li>GL_TO_CPU (copy from OpenGL-&gt;CPU)</li>
<li>GL_TO_CUDA (copy from OpenGL-&gt;CUDA)</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true on success, false on failure </dd></dl>

</div>
</div>
<a id="a3ab747085fde20860837129dcbc8582b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3ab747085fde20860837129dcbc8582b">&#9670;&nbsp;</a></span>Create()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classglTexture.html">glTexture</a>* glTexture::Create </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Allocate an OpenGL texture. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">width</td><td>the width of the texture in pixels </td></tr>
    <tr><td class="paramname">height</td><td>the height of the texture in pixels </td></tr>
    <tr><td class="paramname">format</td><td>GL_RGBA8, GL_RGBA32F, ect. </td></tr>
    <tr><td class="paramname">data</td><td>initialize the texture's memory with this CPU pointer, size is width*height*bpp </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a24d1124dd9e3ee4a885037680e034d24"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a24d1124dd9e3ee4a885037680e034d24">&#9670;&nbsp;</a></span>GetFormat()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t glTexture::GetFormat </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Retrieve the texture's format (e.g. </p>
<p>GL_RGBA8, GL_RGBA32F, ect.) </p>

</div>
</div>
<a id="a7e83b13ce1281d90a59c0cfca7f80834"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e83b13ce1281d90a59c0cfca7f80834">&#9670;&nbsp;</a></span>GetHeight()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t glTexture::GetHeight </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Retrieve the height in pixels of the texture. </p>

</div>
</div>
<a id="acba11f3282339fb2490c930177ec8562"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acba11f3282339fb2490c930177ec8562">&#9670;&nbsp;</a></span>GetID()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t glTexture::GetID </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Retrieve the OpenGL resource handle of the texture. </p>

</div>
</div>
<a id="a35ba15763a0a187bd4e103eda1e2ab5c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a35ba15763a0a187bd4e103eda1e2ab5c">&#9670;&nbsp;</a></span>GetSize()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t glTexture::GetSize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Retrieve the size in bytes of the texture. </p>

</div>
</div>
<a id="ab4e7455f84741b4bc4601bd44df95063"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab4e7455f84741b4bc4601bd44df95063">&#9670;&nbsp;</a></span>GetWidth()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t glTexture::GetWidth </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Retrieve the width in pixels of the texture. </p>

</div>
</div>
<a id="a988866fe886ea2f07208e691a8b9a173"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a988866fe886ea2f07208e691a8b9a173">&#9670;&nbsp;</a></span>Map()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* glTexture::Map </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Map the texture for accessing from the CPU or CUDA. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">device</td><td>either GL_MAP_CPU or GL_MAP_CUDA</td></tr>
    <tr><td class="paramname">flags</td><td>should be one of the following:<ul>
<li>GL_READ_WRITE</li>
<li>GL_READ_ONLY</li>
<li>GL_WRITE_ONLY</li>
<li>GL_WRITE_DISCARD</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CPU pointer to buffer if GL_MAP_CPU was specified, CUDA device pointer to buffer if GL_MAP_CUDA was specified, or NULL if an error occurred mapping the buffer. </dd></dl>

</div>
</div>
<a id="aacbc1ed68a99930b628b41d69997227e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aacbc1ed68a99930b628b41d69997227e">&#9670;&nbsp;</a></span>Render() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void glTexture::Render </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Render the texture at the specified window coordinates. </p>

</div>
</div>
<a id="a38103fc1ec96018601b21131db5144c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a38103fc1ec96018601b21131db5144c9">&#9670;&nbsp;</a></span>Render() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void glTexture::Render </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>height</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Render the texture with the specified position and size. </p>

</div>
</div>
<a id="ab449860cc3d739a6615d93f4a1764f20"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab449860cc3d739a6615d93f4a1764f20">&#9670;&nbsp;</a></span>Render() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void glTexture::Render </td>
          <td>(</td>
          <td class="paramtype">const float4 &amp;&#160;</td>
          <td class="paramname"><em>rect</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Render the texture to the specific screen rectangle. </p>

</div>
</div>
<a id="a803c368b6a26675b4cc45b0aae47f9c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a803c368b6a26675b4cc45b0aae47f9c3">&#9670;&nbsp;</a></span>Unbind()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void glTexture::Unbind </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deactivate using the texture. </p>

</div>
</div>
<a id="aa2f21d5b0b9235bf53744ca71e258841"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa2f21d5b0b9235bf53744ca71e258841">&#9670;&nbsp;</a></span>Unmap()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void glTexture::Unmap </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Unmap the texture from CPU/CUDA access. </p>
<dl class="section note"><dt>Note</dt><dd>the texture will be unbound after calling <a class="el" href="classglTexture.html#aa2f21d5b0b9235bf53744ca71e258841" title="Unmap the texture from CPU/CUDA access. ">Unmap()</a> </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>jetson-utils/<a class="el" href="glTexture_8h_source.html">glTexture.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="classglTexture.html">glTexture</a></li>
    <li class="footer">Generated on Tue Jul 14 2020 21:59:35 for Jetson Inference by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
